package tmproject.hlhj.fhp.upbrintryproject

import android.content.Intent
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.app.AppCompatActivity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import hlhj.fhp.burst.fragment.BurstFgm
import hlhj.fhp.drawskin.GoWebAty
import hlhj.fhp.drawskin.WebFgm
import hlhj.fhp.newslib.activitys.TestAdPlaer
import hlhj.fhp.newslib.fragments.MainFgm
import hlhj.fhp.special.fragments.SpecialFgm
import hlhj.fhp.tvlib.fragment.TvHomeFgm
import kotlinx.android.synthetic.main.aty_fgm.*
import tmproject.hlhj.fhp.tmvote.activitys.VoteListAty
import tmproject.hlhj.fhp.tmvote.fragments.VoteListFgm

/**
 * Created by Never Fear   on 2018\10\16 0016.
Never More....
 */
class FgmAty :AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.aty_fgm)
        supportActionBar?.hide()
        val intExtra = intent.getIntExtra("type", 0)
        if (intExtra==1){
            val mainFgm = MainFgm()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,mainFgm)
            transaction.commit()
        }else if (intExtra==2){
            val tvHomeFgm = TvHomeFgm()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,tvHomeFgm)
            transaction.commit()
        }else if (intExtra==3){
            val specialFgm = SpecialFgm()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,specialFgm)
            transaction.commit()
        }else if (intExtra==4){
            val burstFgm = BurstFgm()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,burstFgm)
            transaction.commit()
        }else if (intExtra==5){
            val intent = Intent(this@FgmAty, VoteListAty::class.java)
            startActivity(intent)
          /*  val voteListFgm = VoteListFgm()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,voteListFgm)
            transaction.commit()*/
        }else if (intExtra==6){
            val burstFgm = WebFgm()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,burstFgm)
            transaction.commit()
     /*       val index = FragmentIndex()
            val transaction = supportFragmentManager.beginTransaction()
            transaction.replace(R.id.rp,index)
            transaction.commit()*/
        }
        /*when(intent.getIntExtra("type",0)){
            1->{
                val mainFgm = MainFgm()
                val transaction = supportFragmentManager.beginTransaction()
                transaction.replace(R.id.rp,mainFgm)
                transaction.commit()
            }
            2->{
                val tvHomeFgm = TvHomeFgm()
                val transaction = supportFragmentManager.beginTransaction()
                transaction.replace(R.id.rp,tvHomeFgm)
                transaction.commit()
            }
            3->{
                val specialFgm = SpecialFgm()
                val transaction = supportFragmentManager.beginTransaction()
                transaction.replace(R.id.rp,specialFgm)
                transaction.commit()
            }
            4->{
                val burstFgm = BurstFgm()
                val transaction = supportFragmentManager.beginTransaction()
                transaction.replace(R.id.rp,burstFgm)
                transaction.commit()
            }
            5->{
                val voteListFgm = VoteListFgm()
                val transaction = supportFragmentManager.beginTransaction()
                transaction.replace(R.id.rp,voteListFgm)
                transaction.commit()
            }
            else->{

            }
        }*/

    }
}